package cn.com.cifi.mars.web.action.sync;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.common.constants.VersionConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/**
 * 
 * @author Administrator
 *
 */
@Api(tags = {"Report同步代码"})
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/report/sync")
public interface IReportSyncController {

	@ApiOperation(value = "1、刷新全盘货值", notes ="刷新全盘货值")
	@PostMapping(value = "syncBase")
	public R<String> syncBase(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "年月（格式：2020-03）", required = false) @RequestParam(value = "yearMonth",required = false) String yearMonth,
			@ApiParam(value = "是否包含禁用的分期（有值则是，为空则否）", required = false) @RequestParam(value = "containsInactive",required = false) String containsInactive
			);

	@ApiOperation(value = "2、同步明源签约信息", notes = "同步明源签约信息：\n"+
			"v1 : 全量同步\n" +
			"v2 : 增量同步\n"
	)
	@PostMapping(value = "syncMyContract")
	public R<String> syncMyContract(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V2) @PathVariable(value = "apiVersion") String apiVersion
	);

	@ApiOperation(value = "3、同步NOS签约信息-全量", notes = "同步NOS签约信息-全量")
	@PostMapping(value = "syncNosContact")
	public R<String> syncNosContact(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion
	);

	@ApiOperation(value = "4、刷新去化率报表(仅去化率报表)", notes = "同步去化率报表(仅去化率报表)")
	@PostMapping(value = "syncRemoval")
	public R<String> syncRemoval(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "年月（格式：2020-03）", required = false) @RequestParam(value = "yearMonth",required = false) String yearMonth
	);

	@ApiOperation(value = "5、操作去化率报表缓存", notes = "操作去化率报表缓存\n" +
			"版本说明：\n" +
			"v1 : 刷新去化率报表缓存\n" +
			"v2 ：清空去化率报表缓存")
	@PostMapping(value = "syncRemovalCache")
	public R<String> syncRemovalCache(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion
	);
	
	@ApiOperation(value = "6、执行去化率报表定时任务(指定月份)", notes = "执行去化率报表定时任务(指定月份)")
	@PostMapping(value = "syncRemovalJob")
	public R<String> syncRemovalJob(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "年月（格式：2020-03）", required = true) @RequestParam(value = "yearMonth",required = true) String yearMonth
	);

	@ApiOperation(value = "7、刷新去化率报表导出数据", notes = "刷新去化率报表导出数据")
	@PostMapping(value = "syncRemovalDataJob")
	public R<String> syncRemovalDataJob(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "年月（格式：2020-03）", required = true) @RequestParam(value = "yearMonth",required = true) String yearMonth
	);
	
}
